package com.jemmyee.task.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.jemmyee.core.entity.BaseEntity;
import com.jemmyee.core.entity.User;
import com.jemmyee.task.web.TaskConstants;

/**
 * @Description:任务
 * @author:jemmyee@gmail.com
 * @date:2011-8-3
 * @version:v1.0
 */
@Entity
@Table(name ="task_task")
public class Task extends BaseEntity implements java.io.Serializable {

	// Fields

	private String id;
	private Integer userId;
	private String  userIP;//发布人IP
	private String taskSn;//唯一标识  20100803110305
	private Short platform;//平台 1:淘宝 2拍拍
	private Integer type;//类型 1实物 2 虚拟 
	private String shopUrl;//店铺连接
	private Double guaranty;//保证金
	private Double point;//发布点
	private Double rewardPoint;//奖励点数
	private Date addTime;
	private Integer sortOrder;
	private Short isDelete;
	private Short isCheck;
	private String brief;//任务说明
	private Short status;//任务状态  0 未接手  1 进行中  2 待确认 3 over
	private String shopkeeper;//掌柜名称
	private Short assignTimelimit;//好评要求时限  0 马上  24(24小时好评)  48  72
	private String assignComment;//指定好评内容  
	private Integer receiveUserId;//接手人
	private String receiveIP;//接手IP
	private Date receiveTime;//接手时间

	
	private User user;//一对一
	private User receiveUser;//一对一
	//关系映射
	@ManyToOne(cascade=CascadeType.MERGE,fetch=FetchType.LAZY)
	@JoinColumn(name="user_id",insertable=false,updatable=false)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne(cascade=CascadeType.MERGE,fetch=FetchType.LAZY)
	@JoinColumn(name="receive_user_id",insertable=false,updatable=false)
	public User getReceiveUser() {
		return receiveUser;
	}

	public void setReceiveUser(User receiveUser) {
		this.receiveUser = receiveUser;
	}

	/** default constructor */
	public Task() {
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@Column(name = "user_id")
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	@Column(name = "task_sn", length = 16)
	public String getTaskSn() {
		return this.taskSn;
	}

	public void setTaskSn(String taskSn) {
		this.taskSn = taskSn;
	}

	@Column(name = "platform")
	public Short getPlatform() {
		return this.platform;
	}

	public void setPlatform(Short platform) {
		this.platform = platform;
	}
	@Column(name = "type")
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "shop_url", length = 100)
	public String getShopUrl() {
		return this.shopUrl;
	}

	public void setShopUrl(String shopUrl) {
		this.shopUrl = shopUrl;
	}

	@Column(name = "guaranty", precision = 10, scale = 3)
	public Double getGuaranty() {
		return this.guaranty;
	}

	public void setGuaranty(Double guaranty) {
		this.guaranty = guaranty;
	}

	@Column(name = "point", precision = 10, scale = 3)
	public Double getPoint() {
		return this.point;
	}

	public void setPoint(Double point) {
		this.point = point;
	}

	@Column(name = "reward_point", precision = 10, scale = 3)
	public Double getRewardPoint() {
		return this.rewardPoint;
	}

	public void setRewardPoint(Double rewardPoint) {
		this.rewardPoint = rewardPoint;
	}

	@Column(name = "add_time", length = 0)
	public Date getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	@Column(name = "sort_order")
	public Integer getSortOrder() {
		return this.sortOrder;
	}

	public void setSortOrder(Integer sortOrder) {
		this.sortOrder = sortOrder;
	}

	@Column(name = "is_delete")
	public Short getIsDelete() {
		return this.isDelete;
	}

	public void setIsDelete(Short isDelete) {
		this.isDelete = isDelete;
	}

	@Column(name = "is_check")
	public Short getIsCheck() {
		return this.isCheck;
	}

	public void setIsCheck(Short isCheck) {
		this.isCheck = isCheck;
	}

	@Column(name = "brief", length = 1000)
	public String getBrief() {
		return this.brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}
	@Column(name = "status")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}
	@Column(name = "shopkeeper", length = 30)
	public String getShopkeeper() {
		return this.shopkeeper;
	}

	public void setShopkeeper(String shopkeeper) {
		this.shopkeeper = shopkeeper;
	}

	@Column(name = "assign_timelimit")
	public Short getAssignTimelimit() {
		return this.assignTimelimit;
	}

	public void setAssignTimelimit(Short assignTimelimit) {
		this.assignTimelimit = assignTimelimit;
	}

	@Column(name = "assign_comment", length = 100)
	public String getAssignComment() {
		return this.assignComment;
	}

	public void setAssignComment(String assignComment) {
		this.assignComment = assignComment;
	}
	@Column(name = "user_ip", length = 60)
	public String getUserIP() {
		return userIP;
	}

	public void setUserIP(String userIP) {
		this.userIP = userIP;
	}
	@Column(name = "receive_user_id")
	public Integer getReceiveUserId() {
		return receiveUserId;
	}

	public void setReceiveUserId(Integer receiveUserId) {
		this.receiveUserId = receiveUserId;
	}
	@Column(name = "receive_ip", length = 60)
	public String getReceiveIP() {
		return receiveIP;
	}

	public void setReceiveIP(String receiveIP) {
		this.receiveIP = receiveIP;
	}
	@Column(name = "receive_time")
	public Date getReceiveTime() {
		return receiveTime;
	}

	public void setReceiveTime(Date receiveTime) {
		this.receiveTime = receiveTime;
	}
	

}